package com.susallwave.srcb.service.sys;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.susallwave.srcb.dto.PermissionTreeNode;
import com.susallwave.srcb.entity.sys.Permission;
import com.susallwave.srcb.response.Result;

import java.util.List;
import java.util.Map;

public interface PermissionService extends IService<Permission> {

    Result<IPage<Permission>> page(int pageNum, int pageSize, String code, String name, String status);

    Result<Void> add(Permission permission);

    Result<Void> edit(Permission permission);

    List<PermissionTreeNode> listPermissionTree();

    Map<String, Object> listPermissionTreeByRoleId(Long roleId);

    Result<Void> isRepeat(String code, String name);

    List<Permission> listByType(String type);

}
